<?php
	$table = new Table( array(
		"id" => array(
			"width" => 20,
			"title" => "ID",
			"type" => "order",
		),
		"from_date" => array(
			"width" => 200,
			"type" => "text",
			"title" => "From Date",
			"link" => 'edit.php?id=$id'
		),
		"to_date" => array(
			"width" => 200,
			"type" => "text",
			"title" => "To Date"
		),
		"season" => array(
			"width" => 100,
			"type" => "text"
		),
	));

    $sql = "SELECT * FROM calendar";
    $rss = $db->query($sql);

	$data = new Data($rss);

	$table->add_data($data->fetch());

	$table->add_submodule( array(
		"module" => $init['module'],
		"title" => "Add New",
		"file" => "form.php",
		"icon" => "add.png"
	));

	$table->add_tool( array(
		"edit" => array(
			"link" => 'edit.php?id=$id',
			"icon" => "edit.png"
		),

		"delete" => array(
			"link" => 'delete.php?id=$id',
			"icon" => "delete.png"
		)
	));

	$table->rain_display($tpl, "table");
?>